-- 创建数据库（如果不存在）
CREATE DATABASE IF NOT EXISTS nacos DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- 使用 nacos 数据库
USE nacos;

/*
 Navicat Premium Dump SQL

 Source Server         : localhost-aegis
 Source Server Type    : MySQL
 Source Server Version : 80032 (8.0.32)
 Source Host           : localhost:3306
 Source Schema         : nacos

 Target Server Type    : MySQL
 Target Server Version : 80032 (8.0.32)
 File Encoding         : 65001

 Date: 27/05/2025 11:22:19
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for config_info
-- ----------------------------
DROP TABLE IF EXISTS `config_info`;
CREATE TABLE `config_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
  `c_desc` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL,
  `c_use` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `effect` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `type` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL,
  `c_schema` text COLLATE utf8mb3_bin,
  `encrypted_data_key` text COLLATE utf8mb3_bin NOT NULL COMMENT '秘钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info';

-- ----------------------------
-- Records of config_info
-- ----------------------------
BEGIN;
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (5, 'gateway.yaml', 'DEFAULT_GROUP', 'spring:\n  cloud:\n    gateway:\n      globalcors:\n        cors-configurations:\n          \'[/**]\': # 适用于所有路径\n            allowedOriginPatterns: \"*\" # 允许的前端域（可改为你的前端地址）\n            allowedMethods:\n              - GET\n              - POST\n              - PUT\n              - DELETE\n              - OPTIONS\n            allowedHeaders: \"*\" # 允许的请求头\n            allowCredentials: true # 允许携带 Cookie\n        add-to-simple-url-handler-mapping: true\n      discovery:\n        locator:\n          enabled: true\n          lower-case-service-id: true', 'b730d520c9a285126c828ffa1b1361e3', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', '', 'aegis-local', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (6, 'common.yaml', 'DEFAULT_GROUP', 'spring:\n  jackson:\n    date-format: yyyy-MM-dd HH:mm:ss\n    time-zone: GMT+8\n  mvc:\n    pathmatch:\n      matching-strategy: ANT_PATH_MATCHER\n  redis:\n    host: localhost\n    port: 6379\n    database: 1\n    password: aegis\n  datasource:\n    url: jdbc:mysql://localhost:3306/aegis\n    username: root\n    password: aegis\n    driver-class-name: com.mysql.jdbc.Driver\n\n    \n# mybatis-plus相关配置\nmybatis-plus:\n  configuration:\n    # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射\n    map-underscore-to-camel-case: true\n    # 如果查询结果中包含空值的列，则 MyBatis 在映射的时候，不会映射这个字段\n    call-setters-on-nulls: true\n    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n  # xml扫描，多个目录用逗号或者分号分隔（告诉 Mapper 所对应的 XML 文件位置）\n  mapper-locations: classpath:mapper/*.xml\n  # 以下配置均有默认值,可以不设置\n  global-config:\n    db-config:\n      #字段策略 IGNORED:\"忽略判断\"  NOT_NULL:\"非 NULL 判断\")  NOT_EMPTY:\"非空判断\"\n      field-strategy: NOT_EMPTY\n      logic-delete-field: deleteFlag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)，这里是个枚举\n      logic-delete-value: 1 # 逻辑已删除值(默认为 1)\n      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)\n    \ndubbo:\n  application:\n    qos-enable: false\n  consumer:\n    check: false\n    retries: 2\n    timeout: 10000\n  provider:\n    timeout: 10000\n\naegis:\n  user:\n    tokenConfig:\n      # token 有效期（单位：秒） 默认30天，-1 代表永久有效\n      timeout: 2592000\n      # token 最低活跃频率（单位：秒），如果 token 超过此时间没有访问系统就会被冻结，默认-1 代表不限制，永不冻结\n      active-timeout: 604800\n      # 是否允许同一账号多地同时登录 （为 true 时允许一起登录, 为 false 时新登录挤掉旧登录）\n      is-concurrent: true\n      # 在多人登录同一账号时，是否共用一个 token （为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token）\n      is-share: false\n      # token 风格（默认可取值：uuid、simple-uuid、random-32、random-64、random-128、tik）\n      token-style: uuid\n      # 是否输出操作日志 \n      is-log: true\n  common:\n    token:\n      #缓存用户的权限时间，单位秒\n      # cachePermissionTime: 180\n      #是否缓存用户权限信息\n      cachePermission: false \n      # 管理员角色key\n      adminRoles: admin\n    web:\n      #生产环境请关闭\n      show-sys-error: true\n      #包的基础路径，多个用逗号隔开 \n      base-pack-paths: com.aegis', 'fc8bb6b9d72acf5b68c12724fa5a0bd4', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', '', 'aegis-local', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (7, 'manage.yaml', 'DEFAULT_GROUP', 'aegis:\n  manage:\n    pwdPrivateKey: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALCWTNYTePNq0Ti5OOxTalEbk0zLc7Bbke2oz6izsp8gaXezO7T7uAc3jStoWFnUaeuEnOS90RoDJj/xZrk5sFa8L11p/LDCDApppk5CgtMMqCkefGm8vfOaUAl1Jqw1Nnx3WXMp0MXl68vmCYQ72So8sWUpjuQxKbzcUwWO3OQzAgMBAAECgYA7sMKORozG819/phSYxeWVPxX+inMztPBR/pMbOorxgRpFjP9swP3G6r88YgwjaUrYgr4qEAPDoDbovGf1yotRZj8d+Iir1T36+ro2YwnFIS3ObSiKNui0vhZSiyRgse/AnB6fD47ZyJhaTjKsFBTPMhNuM4me+KprAMUmi45z2QJBAOOA8DdVyGT69FwpjZW6emWRkf8HeGkjISxgG/TJw5PQpy+H0nmLeWMSOIN+8f57rqt/szOGCUmDXr0M0FgXILcCQQDGtK/48gpftCOB2p7k087TLNQgnOA65iLuT+GmsfCK7YF6Wb5iqWGkU3gy6GEv9iVQhP/HjvThI6xUuwMiNuRlAkAbSPeGa29hTQfJleI5Nug/DjpoT8kNMv1jiRNRRHGEZN3oQW3ozeV9EE5e1vbHAqZsQyCG6WhrvKm8GrFSH1P5AkA74ZveY+KocLr6mQ2lXAdKMIpEwcH5Pf1s3/naqGkbFPQeEQmE5hKc2OKyRMF1GLKqD0qdswEtD/kRF8Kb/vrZAkABWitxGnIKHh5dnK4zg9GtEpI3HfwC3ocQSQ4M3Pn7nJgM35RJtSttWZNa5VjyCjoqxtYIH9wujU69MocPWPPb\n    pwdPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwlkzWE3jzatE4uTjsU2pRG5NMy3OwW5HtqM+os7KfIGl3szu0+7gHN40raFhZ1GnrhJzkvdEaAyY/8Wa5ObBWvC9dafywwgwKaaZOQoLTDKgpHnxpvL3zmlAJdSasNTZ8d1lzKdDF5evL5gmEO9kqPLFlKY7kMSm83FMFjtzkMwIDAQAB\n    pwdSalt: dcc120c3b7e11b10d620bb366e069594\n    appId: aegis\n    appName: ageis管理平台\n    adminRoles: admin\n  user:\n    appId: aegis', 'f0554c2e2235f41a6ea8ecbce43b2d9a', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', '', 'aegis-local', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (8, 'gateway-routes.yaml', 'DEFAULT_GROUP', 'spring:\n  cloud:\n    gateway:\n      routes:\n      - id: aegis-gateway-manage-service\n        uri: lb://aegis-gateway-manage-service\n        predicates: [Path=/aegis-manage/**]\n      - id: demo1\n        uri: http://192.168.20.33:10001\n        predicates: [Path=/demo1/**]\n      - predicates: [Path=/demo2/**]\n        id: demo2\n        uri: http://192.168.20.33:10002\n', '503ed2af7e1306bfdfc006e808dba936', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', '', 'aegis-local', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (9, 'gateway.yaml', 'DEFAULT_GROUP', 'spring:\n  cloud:\n    gateway:\n      globalcors:\n        cors-configurations:\n          \'[/**]\': # 适用于所有路径\n            allowedOriginPatterns: \"*\" # 允许的前端域（可改为你的前端地址）\n            allowedMethods:\n              - GET\n              - POST\n              - PUT\n              - DELETE\n              - OPTIONS\n            allowedHeaders: \"*\" # 允许的请求头\n            allowCredentials: true # 允许携带 Cookie\n        add-to-simple-url-handler-mapping: true\n      discovery:\n        locator:\n          enabled: true\n          lower-case-service-id: true', 'b730d520c9a285126c828ffa1b1361e3', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', '', 'aegis-prod', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (10, 'common.yaml', 'DEFAULT_GROUP', 'spring:\n  jackson:\n    date-format: yyyy-MM-dd HH:mm:ss\n    time-zone: GMT+8\n  mvc:\n    pathmatch:\n      matching-strategy: ANT_PATH_MATCHER\n  redis:\n    host: aegis-redis\n    port: 6379\n    database: 1\n    password: aegis\n  datasource:\n    url: jdbc:mysql://aegis-mysql:3306/aegis\n    username: root\n    password: aegis\n    driver-class-name: com.mysql.jdbc.Driver\n\n    \n# mybatis-plus相关配置\nmybatis-plus:\n  configuration:\n    # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射\n    map-underscore-to-camel-case: true\n    # 如果查询结果中包含空值的列，则 MyBatis 在映射的时候，不会映射这个字段\n    call-setters-on-nulls: true\n  # xml扫描，多个目录用逗号或者分号分隔（告诉 Mapper 所对应的 XML 文件位置）\n  mapper-locations: classpath:mapper/*.xml\n  # 以下配置均有默认值,可以不设置\n  global-config:\n    db-config:\n      #主键类型 AUTO:\"数据库ID自增\" INPUT:\"用户输入ID\",ID_WORKER:\"全局唯一ID (数字类型唯一ID)\", UUID:\"全局唯一ID UUID\";\n      #      id-type: auto\n      #字段策略 IGNORED:\"忽略判断\"  NOT_NULL:\"非 NULL 判断\")  NOT_EMPTY:\"非空判断\"\n      field-strategy: NOT_EMPTY\n      logic-delete-field: deleteFlag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)，这里是个枚举\n      logic-delete-value: 1 # 逻辑已删除值(默认为 1)\n      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)\n    \ndubbo:\n  application:\n    qos-enable: false\n  consumer:\n    check: false\n    retries: 2\n    timeout: 10000\n  provider:\n    timeout: 10000\n\naegis:\n  user:\n    tokenConfig:\n      # token 有效期（单位：秒） 默认30天，-1 代表永久有效\n      timeout: 2592000\n      # token 最低活跃频率（单位：秒），如果 token 超过此时间没有访问系统就会被冻结，默认-1 代表不限制，永不冻结\n      active-timeout: 604800\n      # 是否允许同一账号多地同时登录 （为 true 时允许一起登录, 为 false 时新登录挤掉旧登录）\n      is-concurrent: true\n      # 在多人登录同一账号时，是否共用一个 token （为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token）\n      is-share: false\n      # token 风格（默认可取值：uuid、simple-uuid、random-32、random-64、random-128、tik）\n      token-style: uuid\n      # 是否输出操作日志 \n      is-log: true\n  common:\n    token:\n      #是否缓存用户权限信息\n      cachePermission: false \n      # 管理员角色key\n      adminRoles: admin\n    web:\n      #生产环境请关闭\n      show-sys-error: false\n      #包的基础路径，多个用逗号隔开 \n      base-pack-paths: com.aegis\n', '84f75655b6795d3d83a8433c91c78dcf', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', '', 'aegis-prod', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (11, 'manage.yaml', 'DEFAULT_GROUP', 'aegis:\n  manage:\n    pwdPrivateKey: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALCWTNYTePNq0Ti5OOxTalEbk0zLc7Bbke2oz6izsp8gaXezO7T7uAc3jStoWFnUaeuEnOS90RoDJj/xZrk5sFa8L11p/LDCDApppk5CgtMMqCkefGm8vfOaUAl1Jqw1Nnx3WXMp0MXl68vmCYQ72So8sWUpjuQxKbzcUwWO3OQzAgMBAAECgYA7sMKORozG819/phSYxeWVPxX+inMztPBR/pMbOorxgRpFjP9swP3G6r88YgwjaUrYgr4qEAPDoDbovGf1yotRZj8d+Iir1T36+ro2YwnFIS3ObSiKNui0vhZSiyRgse/AnB6fD47ZyJhaTjKsFBTPMhNuM4me+KprAMUmi45z2QJBAOOA8DdVyGT69FwpjZW6emWRkf8HeGkjISxgG/TJw5PQpy+H0nmLeWMSOIN+8f57rqt/szOGCUmDXr0M0FgXILcCQQDGtK/48gpftCOB2p7k087TLNQgnOA65iLuT+GmsfCK7YF6Wb5iqWGkU3gy6GEv9iVQhP/HjvThI6xUuwMiNuRlAkAbSPeGa29hTQfJleI5Nug/DjpoT8kNMv1jiRNRRHGEZN3oQW3ozeV9EE5e1vbHAqZsQyCG6WhrvKm8GrFSH1P5AkA74ZveY+KocLr6mQ2lXAdKMIpEwcH5Pf1s3/naqGkbFPQeEQmE5hKc2OKyRMF1GLKqD0qdswEtD/kRF8Kb/vrZAkABWitxGnIKHh5dnK4zg9GtEpI3HfwC3ocQSQ4M3Pn7nJgM35RJtSttWZNa5VjyCjoqxtYIH9wujU69MocPWPPb\n    pwdPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwlkzWE3jzatE4uTjsU2pRG5NMy3OwW5HtqM+os7KfIGl3szu0+7gHN40raFhZ1GnrhJzkvdEaAyY/8Wa5ObBWvC9dafywwgwKaaZOQoLTDKgpHnxpvL3zmlAJdSasNTZ8d1lzKdDF5evL5gmEO9kqPLFlKY7kMSm83FMFjtzkMwIDAQAB\n    pwdSalt: dcc120c3b7e11b10d620bb366e069594\n    appId: aegis\n    appName: ageis管理平台\n    adminRoles: admin\n  user:\n    appId: aegis', 'f0554c2e2235f41a6ea8ecbce43b2d9a', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', '', 'aegis-prod', NULL, NULL, NULL, 'yaml', NULL, '');
INSERT INTO `config_info` (`id`, `data_id`, `group_id`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `app_name`, `tenant_id`, `c_desc`, `c_use`, `effect`, `type`, `c_schema`, `encrypted_data_key`) VALUES (12, 'gateway-routes.yaml', 'DEFAULT_GROUP', 'spring:\n  cloud:\n    gateway:\n      routes:\n      - id: aegis-gateway-manage-service\n        uri: lb://aegis-gateway-manage-service\n        predicates: [Path=/aegis-manage/**]\n      - id: demo1\n        uri: http://192.168.20.33:10001\n        predicates: [Path=/demo1/**]\n      - predicates: [Path=/demo2/**]\n        id: demo2\n        uri: http://192.168.20.33:10002\n', '503ed2af7e1306bfdfc006e808dba936', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', '', 'aegis-prod', NULL, NULL, NULL, 'yaml', NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for config_info_aggr
-- ----------------------------
DROP TABLE IF EXISTS `config_info_aggr`;
CREATE TABLE `config_info_aggr` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `datum_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'datum_id',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT '内容',
  `gmt_modified` datetime NOT NULL COMMENT '修改时间',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL,
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='增加租户字段';

-- ----------------------------
-- Records of config_info_aggr
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_info_beta
-- ----------------------------
DROP TABLE IF EXISTS `config_info_beta`;
CREATE TABLE `config_info_beta` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `beta_ips` varchar(1024) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'betaIps',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
  `encrypted_data_key` text COLLATE utf8mb3_bin NOT NULL COMMENT '秘钥',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info_beta';

-- ----------------------------
-- Records of config_info_beta
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_info_tag
-- ----------------------------
DROP TABLE IF EXISTS `config_info_tag`;
CREATE TABLE `config_info_tag` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
  `tag_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_id',
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL COMMENT 'content',
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COLLATE utf8mb3_bin COMMENT 'source user',
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'source ip',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_info_tag';

-- ----------------------------
-- Records of config_info_tag
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for config_tags_relation
-- ----------------------------
DROP TABLE IF EXISTS `config_tags_relation`;
CREATE TABLE `config_tags_relation` (
  `id` bigint NOT NULL COMMENT 'id',
  `tag_name` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'tag_name',
  `tag_type` varchar(64) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tag_type',
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
  `nid` bigint NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`nid`),
  UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='config_tag_relation';

-- ----------------------------
-- Records of config_tags_relation
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for group_capacity
-- ----------------------------
DROP TABLE IF EXISTS `group_capacity`;
CREATE TABLE `group_capacity` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Group ID，空字符表示整个集群',
  `quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额，0表示使用默认值',
  `usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限，单位为字节，0表示使用默认值',
  `max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数，，0表示使用默认值',
  `max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值',
  `max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='集群、各Group容量信息表';

-- ----------------------------
-- Records of group_capacity
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for his_config_info
-- ----------------------------
DROP TABLE IF EXISTS `his_config_info`;
CREATE TABLE `his_config_info` (
  `id` bigint unsigned NOT NULL,
  `nid` bigint unsigned NOT NULL AUTO_INCREMENT,
  `data_id` varchar(255) COLLATE utf8mb3_bin NOT NULL,
  `group_id` varchar(128) COLLATE utf8mb3_bin NOT NULL,
  `app_name` varchar(128) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'app_name',
  `content` longtext COLLATE utf8mb3_bin NOT NULL,
  `md5` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL,
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `src_user` text COLLATE utf8mb3_bin,
  `src_ip` varchar(50) COLLATE utf8mb3_bin DEFAULT NULL,
  `op_type` char(10) COLLATE utf8mb3_bin DEFAULT NULL,
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT '租户字段',
  `encrypted_data_key` text COLLATE utf8mb3_bin NOT NULL COMMENT '秘钥',
  PRIMARY KEY (`nid`),
  KEY `idx_gmt_create` (`gmt_create`),
  KEY `idx_gmt_modified` (`gmt_modified`),
  KEY `idx_did` (`data_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='多租户改造';

-- ----------------------------
-- Records of his_config_info
-- ----------------------------
BEGIN;
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 9, 'gateway.yaml', 'DEFAULT_GROUP', '', 'spring:\n  cloud:\n    gateway:\n      globalcors:\n        cors-configurations:\n          \'[/**]\': # 适用于所有路径\n            allowedOriginPatterns: \"*\" # 允许的前端域（可改为你的前端地址）\n            allowedMethods:\n              - GET\n              - POST\n              - PUT\n              - DELETE\n              - OPTIONS\n            allowedHeaders: \"*\" # 允许的请求头\n            allowCredentials: true # 允许携带 Cookie\n        add-to-simple-url-handler-mapping: true\n      discovery:\n        locator:\n          enabled: true\n          lower-case-service-id: true', 'b730d520c9a285126c828ffa1b1361e3', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', 'I', 'aegis-local', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 10, 'common.yaml', 'DEFAULT_GROUP', '', 'spring:\n  jackson:\n    date-format: yyyy-MM-dd HH:mm:ss\n    time-zone: GMT+8\n  mvc:\n    pathmatch:\n      matching-strategy: ANT_PATH_MATCHER\n  redis:\n    host: localhost\n    port: 6379\n    database: 1\n    password: aegis\n  datasource:\n    url: jdbc:mysql://localhost:3306/aegis\n    username: root\n    password: aegis\n    driver-class-name: com.mysql.jdbc.Driver\n\n    \n# mybatis-plus相关配置\nmybatis-plus:\n  configuration:\n    # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射\n    map-underscore-to-camel-case: true\n    # 如果查询结果中包含空值的列，则 MyBatis 在映射的时候，不会映射这个字段\n    call-setters-on-nulls: true\n    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n  # xml扫描，多个目录用逗号或者分号分隔（告诉 Mapper 所对应的 XML 文件位置）\n  mapper-locations: classpath:mapper/*.xml\n  # 以下配置均有默认值,可以不设置\n  global-config:\n    db-config:\n      #字段策略 IGNORED:\"忽略判断\"  NOT_NULL:\"非 NULL 判断\")  NOT_EMPTY:\"非空判断\"\n      field-strategy: NOT_EMPTY\n      logic-delete-field: deleteFlag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)，这里是个枚举\n      logic-delete-value: 1 # 逻辑已删除值(默认为 1)\n      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)\n    \ndubbo:\n  application:\n    qos-enable: false\n  consumer:\n    check: false\n    retries: 2\n    timeout: 10000\n  provider:\n    timeout: 10000\n\naegis:\n  user:\n    tokenConfig:\n      # token 有效期（单位：秒） 默认30天，-1 代表永久有效\n      timeout: 2592000\n      # token 最低活跃频率（单位：秒），如果 token 超过此时间没有访问系统就会被冻结，默认-1 代表不限制，永不冻结\n      active-timeout: 604800\n      # 是否允许同一账号多地同时登录 （为 true 时允许一起登录, 为 false 时新登录挤掉旧登录）\n      is-concurrent: true\n      # 在多人登录同一账号时，是否共用一个 token （为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token）\n      is-share: false\n      # token 风格（默认可取值：uuid、simple-uuid、random-32、random-64、random-128、tik）\n      token-style: uuid\n      # 是否输出操作日志 \n      is-log: true\n  common:\n    token:\n      #缓存用户的权限时间，单位秒\n      # cachePermissionTime: 180\n      #是否缓存用户权限信息\n      cachePermission: false \n      # 管理员角色key\n      adminRoles: admin\n    web:\n      #生产环境请关闭\n      show-sys-error: true\n      #包的基础路径，多个用逗号隔开 \n      base-pack-paths: com.aegis', 'fc8bb6b9d72acf5b68c12724fa5a0bd4', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', 'I', 'aegis-local', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 11, 'manage.yaml', 'DEFAULT_GROUP', '', 'aegis:\n  manage:\n    pwdPrivateKey: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALCWTNYTePNq0Ti5OOxTalEbk0zLc7Bbke2oz6izsp8gaXezO7T7uAc3jStoWFnUaeuEnOS90RoDJj/xZrk5sFa8L11p/LDCDApppk5CgtMMqCkefGm8vfOaUAl1Jqw1Nnx3WXMp0MXl68vmCYQ72So8sWUpjuQxKbzcUwWO3OQzAgMBAAECgYA7sMKORozG819/phSYxeWVPxX+inMztPBR/pMbOorxgRpFjP9swP3G6r88YgwjaUrYgr4qEAPDoDbovGf1yotRZj8d+Iir1T36+ro2YwnFIS3ObSiKNui0vhZSiyRgse/AnB6fD47ZyJhaTjKsFBTPMhNuM4me+KprAMUmi45z2QJBAOOA8DdVyGT69FwpjZW6emWRkf8HeGkjISxgG/TJw5PQpy+H0nmLeWMSOIN+8f57rqt/szOGCUmDXr0M0FgXILcCQQDGtK/48gpftCOB2p7k087TLNQgnOA65iLuT+GmsfCK7YF6Wb5iqWGkU3gy6GEv9iVQhP/HjvThI6xUuwMiNuRlAkAbSPeGa29hTQfJleI5Nug/DjpoT8kNMv1jiRNRRHGEZN3oQW3ozeV9EE5e1vbHAqZsQyCG6WhrvKm8GrFSH1P5AkA74ZveY+KocLr6mQ2lXAdKMIpEwcH5Pf1s3/naqGkbFPQeEQmE5hKc2OKyRMF1GLKqD0qdswEtD/kRF8Kb/vrZAkABWitxGnIKHh5dnK4zg9GtEpI3HfwC3ocQSQ4M3Pn7nJgM35RJtSttWZNa5VjyCjoqxtYIH9wujU69MocPWPPb\n    pwdPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwlkzWE3jzatE4uTjsU2pRG5NMy3OwW5HtqM+os7KfIGl3szu0+7gHN40raFhZ1GnrhJzkvdEaAyY/8Wa5ObBWvC9dafywwgwKaaZOQoLTDKgpHnxpvL3zmlAJdSasNTZ8d1lzKdDF5evL5gmEO9kqPLFlKY7kMSm83FMFjtzkMwIDAQAB\n    pwdSalt: dcc120c3b7e11b10d620bb366e069594\n    appId: aegis\n    appName: ageis管理平台\n    adminRoles: admin\n  user:\n    appId: aegis', 'f0554c2e2235f41a6ea8ecbce43b2d9a', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', 'I', 'aegis-local', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 12, 'gateway-routes.yaml', 'DEFAULT_GROUP', '', 'spring:\n  cloud:\n    gateway:\n      routes:\n      - id: aegis-gateway-manage-service\n        uri: lb://aegis-gateway-manage-service\n        predicates: [Path=/aegis-manage/**]\n      - id: demo1\n        uri: http://192.168.20.33:10001\n        predicates: [Path=/demo1/**]\n      - predicates: [Path=/demo2/**]\n        id: demo2\n        uri: http://192.168.20.33:10002\n', '503ed2af7e1306bfdfc006e808dba936', '2025-05-27 03:21:49', '2025-05-27 03:21:49', NULL, '192.168.208.1', 'I', 'aegis-local', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 13, 'gateway.yaml', 'DEFAULT_GROUP', '', 'spring:\n  cloud:\n    gateway:\n      globalcors:\n        cors-configurations:\n          \'[/**]\': # 适用于所有路径\n            allowedOriginPatterns: \"*\" # 允许的前端域（可改为你的前端地址）\n            allowedMethods:\n              - GET\n              - POST\n              - PUT\n              - DELETE\n              - OPTIONS\n            allowedHeaders: \"*\" # 允许的请求头\n            allowCredentials: true # 允许携带 Cookie\n        add-to-simple-url-handler-mapping: true\n      discovery:\n        locator:\n          enabled: true\n          lower-case-service-id: true', 'b730d520c9a285126c828ffa1b1361e3', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', 'I', 'aegis-prod', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 14, 'common.yaml', 'DEFAULT_GROUP', '', 'spring:\n  jackson:\n    date-format: yyyy-MM-dd HH:mm:ss\n    time-zone: GMT+8\n  mvc:\n    pathmatch:\n      matching-strategy: ANT_PATH_MATCHER\n  redis:\n    host: aegis-redis\n    port: 6379\n    database: 1\n    password: aegis\n  datasource:\n    url: jdbc:mysql://aegis-mysql:3306/aegis\n    username: root\n    password: aegis\n    driver-class-name: com.mysql.jdbc.Driver\n\n    \n# mybatis-plus相关配置\nmybatis-plus:\n  configuration:\n    # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射\n    map-underscore-to-camel-case: true\n    # 如果查询结果中包含空值的列，则 MyBatis 在映射的时候，不会映射这个字段\n    call-setters-on-nulls: true\n  # xml扫描，多个目录用逗号或者分号分隔（告诉 Mapper 所对应的 XML 文件位置）\n  mapper-locations: classpath:mapper/*.xml\n  # 以下配置均有默认值,可以不设置\n  global-config:\n    db-config:\n      #主键类型 AUTO:\"数据库ID自增\" INPUT:\"用户输入ID\",ID_WORKER:\"全局唯一ID (数字类型唯一ID)\", UUID:\"全局唯一ID UUID\";\n      #      id-type: auto\n      #字段策略 IGNORED:\"忽略判断\"  NOT_NULL:\"非 NULL 判断\")  NOT_EMPTY:\"非空判断\"\n      field-strategy: NOT_EMPTY\n      logic-delete-field: deleteFlag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)，这里是个枚举\n      logic-delete-value: 1 # 逻辑已删除值(默认为 1)\n      logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)\n    \ndubbo:\n  application:\n    qos-enable: false\n  consumer:\n    check: false\n    retries: 2\n    timeout: 10000\n  provider:\n    timeout: 10000\n\naegis:\n  user:\n    tokenConfig:\n      # token 有效期（单位：秒） 默认30天，-1 代表永久有效\n      timeout: 2592000\n      # token 最低活跃频率（单位：秒），如果 token 超过此时间没有访问系统就会被冻结，默认-1 代表不限制，永不冻结\n      active-timeout: 604800\n      # 是否允许同一账号多地同时登录 （为 true 时允许一起登录, 为 false 时新登录挤掉旧登录）\n      is-concurrent: true\n      # 在多人登录同一账号时，是否共用一个 token （为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token）\n      is-share: false\n      # token 风格（默认可取值：uuid、simple-uuid、random-32、random-64、random-128、tik）\n      token-style: uuid\n      # 是否输出操作日志 \n      is-log: true\n  common:\n    token:\n      #是否缓存用户权限信息\n      cachePermission: false \n      # 管理员角色key\n      adminRoles: admin\n    web:\n      #生产环境请关闭\n      show-sys-error: true\n      #包的基础路径，多个用逗号隔开 \n      base-pack-paths: com.aegis\n', '84f75655b6795d3d83a8433c91c78dcf', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', 'I', 'aegis-prod', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 15, 'manage.yaml', 'DEFAULT_GROUP', '', 'aegis:\n  manage:\n    pwdPrivateKey: MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBALCWTNYTePNq0Ti5OOxTalEbk0zLc7Bbke2oz6izsp8gaXezO7T7uAc3jStoWFnUaeuEnOS90RoDJj/xZrk5sFa8L11p/LDCDApppk5CgtMMqCkefGm8vfOaUAl1Jqw1Nnx3WXMp0MXl68vmCYQ72So8sWUpjuQxKbzcUwWO3OQzAgMBAAECgYA7sMKORozG819/phSYxeWVPxX+inMztPBR/pMbOorxgRpFjP9swP3G6r88YgwjaUrYgr4qEAPDoDbovGf1yotRZj8d+Iir1T36+ro2YwnFIS3ObSiKNui0vhZSiyRgse/AnB6fD47ZyJhaTjKsFBTPMhNuM4me+KprAMUmi45z2QJBAOOA8DdVyGT69FwpjZW6emWRkf8HeGkjISxgG/TJw5PQpy+H0nmLeWMSOIN+8f57rqt/szOGCUmDXr0M0FgXILcCQQDGtK/48gpftCOB2p7k087TLNQgnOA65iLuT+GmsfCK7YF6Wb5iqWGkU3gy6GEv9iVQhP/HjvThI6xUuwMiNuRlAkAbSPeGa29hTQfJleI5Nug/DjpoT8kNMv1jiRNRRHGEZN3oQW3ozeV9EE5e1vbHAqZsQyCG6WhrvKm8GrFSH1P5AkA74ZveY+KocLr6mQ2lXAdKMIpEwcH5Pf1s3/naqGkbFPQeEQmE5hKc2OKyRMF1GLKqD0qdswEtD/kRF8Kb/vrZAkABWitxGnIKHh5dnK4zg9GtEpI3HfwC3ocQSQ4M3Pn7nJgM35RJtSttWZNa5VjyCjoqxtYIH9wujU69MocPWPPb\n    pwdPublicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwlkzWE3jzatE4uTjsU2pRG5NMy3OwW5HtqM+os7KfIGl3szu0+7gHN40raFhZ1GnrhJzkvdEaAyY/8Wa5ObBWvC9dafywwgwKaaZOQoLTDKgpHnxpvL3zmlAJdSasNTZ8d1lzKdDF5evL5gmEO9kqPLFlKY7kMSm83FMFjtzkMwIDAQAB\n    pwdSalt: dcc120c3b7e11b10d620bb366e069594\n    appId: aegis\n    appName: ageis管理平台\n    adminRoles: admin\n  user:\n    appId: aegis', 'f0554c2e2235f41a6ea8ecbce43b2d9a', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', 'I', 'aegis-prod', '');
INSERT INTO `his_config_info` (`id`, `nid`, `data_id`, `group_id`, `app_name`, `content`, `md5`, `gmt_create`, `gmt_modified`, `src_user`, `src_ip`, `op_type`, `tenant_id`, `encrypted_data_key`) VALUES (0, 16, 'gateway-routes.yaml', 'DEFAULT_GROUP', '', 'spring:\n  cloud:\n    gateway:\n      routes:\n      - id: aegis-gateway-manage-service\n        uri: lb://aegis-gateway-manage-service\n        predicates: [Path=/aegis-manage/**]\n      - id: demo1\n        uri: http://192.168.20.33:10001\n        predicates: [Path=/demo1/**]\n      - predicates: [Path=/demo2/**]\n        id: demo2\n        uri: http://192.168.20.33:10002\n', '503ed2af7e1306bfdfc006e808dba936', '2025-05-27 03:21:56', '2025-05-27 03:21:56', NULL, '192.168.208.1', 'I', 'aegis-prod', '');
COMMIT;

-- ----------------------------
-- Table structure for permissions
-- ----------------------------
DROP TABLE IF EXISTS `permissions`;
CREATE TABLE `permissions` (
  `role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resource` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `action` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
  UNIQUE KEY `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of permissions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for roles
-- ----------------------------
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
  `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  UNIQUE KEY `idx_user_role` (`username`,`role`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of roles
-- ----------------------------
BEGIN;
INSERT INTO `roles` (`username`, `role`) VALUES ('nacos', 'ROLE_ADMIN');
COMMIT;

-- ----------------------------
-- Table structure for tenant_capacity
-- ----------------------------
DROP TABLE IF EXISTS `tenant_capacity`;
CREATE TABLE `tenant_capacity` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
  `quota` int unsigned NOT NULL DEFAULT '0' COMMENT '配额，0表示使用默认值',
  `usage` int unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限，单位为字节，0表示使用默认值',
  `max_aggr_count` int unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
  `max_aggr_size` int unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限，单位为字节，0表示使用默认值',
  `max_history_count` int unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='租户容量信息表';

-- ----------------------------
-- Records of tenant_capacity
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tenant_info
-- ----------------------------
DROP TABLE IF EXISTS `tenant_info`;
CREATE TABLE `tenant_info` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `kp` varchar(128) COLLATE utf8mb3_bin NOT NULL COMMENT 'kp',
  `tenant_id` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_id',
  `tenant_name` varchar(128) COLLATE utf8mb3_bin DEFAULT '' COMMENT 'tenant_name',
  `tenant_desc` varchar(256) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'tenant_desc',
  `create_source` varchar(32) COLLATE utf8mb3_bin DEFAULT NULL COMMENT 'create_source',
  `gmt_create` bigint NOT NULL COMMENT '创建时间',
  `gmt_modified` bigint NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin COMMENT='tenant_info';

-- ----------------------------
-- Records of tenant_info
-- ----------------------------
BEGIN;
INSERT INTO `tenant_info` (`id`, `kp`, `tenant_id`, `tenant_name`, `tenant_desc`, `create_source`, `gmt_create`, `gmt_modified`) VALUES (1, '1', 'aegis-local', 'aegis-local', '本地环境', 'nacos', 1748316011140, 1748316011140);
INSERT INTO `tenant_info` (`id`, `kp`, `tenant_id`, `tenant_name`, `tenant_desc`, `create_source`, `gmt_create`, `gmt_modified`) VALUES (2, '1', 'aegis-prod', 'aegis-prod', '生产环境', 'nacos', 1748316029074, 1748316029074);
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `enabled` tinyint(1) NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` (`username`, `password`, `enabled`) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
